﻿using CDCW.API;
using CGSB.AppCode;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using YanWF;

namespace CGSB.View
{
    public partial class WorkIndex : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            WFHelp WF = new WFHelp();

            ////公告
            //DataTable dtGG = new ZH_XTGGB().GetEntities(d => DateTime.Now.Date >= d.ZDSTime && DateTime.Now.Date <= d.ZDETime).OrderByDescending(d => d.CRDate).ToList().ToDataTable();
            //dtGG.Columns.Add("URL");
            //for (int i = 0; i < dtGG.Rows.Count; i++)
            //{
            //    dtGG.Rows[i]["URL"] = "Comon/CommonMangner.aspx?FormCode=XTGG&&FormID=" + dtGG.Rows[i]["ID"].ToString();
            //}
            //RepXTGG.DataSource = dtGG;
            //RepXTGG.DataBind();
             
            hidusername.Value = UserInfo.User.UserName;

            var list1 = new JH_CG_CGGLB().GetEntities(" isnull( PSUser,'')='' and CRUser='" + UserInfo.User.UserName + "'");
            var list2 = new JH_CG_CGGLB().GetDTByCommand(" select * from JH_CG_CGGL c left join dbo.JH_CG_PSJG g on c.ID=g.CGID and g.CRUser='" + UserInfo.User.UserName + "' where ','+c.PSUser+',' like '%," + UserInfo.User.UserName + ",%' and g.CRUser is null ");
            var list3 = new JH_CG_CGGLB().GetEntities(" isnull( PSUser,'')!='' and Status!='1' and CRUser='" + UserInfo.User.UserName + "'");

            lblSum1.Text = list1.Count().ToString();
            lblSum2.Text = list2.Rows.Count.ToString();
            lblSum3.Text = list3.Count().ToString();
 
        }


    }
}